cache data in notebook to have access to most recent when not connect to internet
## time latitude longitude
## Min. :2017-12-26 21:19:32 Min. :-62.51 Min. :-180.0
## 1st Qu.:2018-01-03 04:26:26 1st Qu.: 35.66 1st Qu.:-149.5
## Median :2018-01-10 07:10:53 Median : 38.82 Median :-121.1
## Mean :2018-01-10 05:05:26 Mean : 42.27 Mean :-118.0
## 3rd Qu.:2018-01-17 01:01:44 3rd Qu.: 58.19 3rd Qu.:-116.8
## Max. :2018-01-25 21:02:41 Max. : 84.66 Max. : 180.0
##
## depth mag magType nst
## Min. : -3.26 Min. :-0.820 Length:9243 Min. : 0.00
## 1st Qu.: 3.82 1st Qu.: 0.700 Class :character 1st Qu.: 8.00
## Median : 8.30 Median : 1.200 Mode :character Median : 14.00
## Mean : 23.61 Mean : 1.486 Mean : 18.74
## 3rd Qu.: 17.30 3rd Qu.: 1.900 3rd Qu.: 23.00
## Max. :666.46 Max. : 7.900 Max. :289.00
## NA's :1 NA's :3743
## gap dmin rms net
## Min. : 13.0 Min. : 0.0001 Min. :0.0000 Length:9243
## 1st Qu.: 73.0 1st Qu.: 0.0184 1st Qu.:0.0900 Class :character
## Median :109.0 Median : 0.0556 Median :0.1800 Mode :character
## Mean :124.8 Mean : 0.4992 Mean :0.2973
## 3rd Qu.:163.0 3rd Qu.: 0.1500 3rd Qu.:0.4600
## Max. :356.0 Max. :37.2230 Max. :4.1200
## NA's :2901 NA's :2953 NA's :3
## id updated place
## Length:9243 Min. :2017-12-26 22:20:20 Length:9243
## Class :character 1st Qu.:2018-01-08 17:59:25 Class :character
## Mode :character Median :2018-01-13 02:32:21 Mode :character
## Mean :2018-01-13 17:03:22
## 3rd Qu.:2018-01-19 23:05:28
## Max. :2018-01-25 21:15:05
##
## type horizontalError depthError magError
## Length:9243 Min. : 0.00 Min. : 0.00 Min. :0.0000
## Class :character 1st Qu.: 0.25 1st Qu.: 0.42 1st Qu.:0.0990
## Mode :character Median : 0.42 Median : 0.78 Median :0.1560
## Mean : 1.75 Mean : 12.46 Mean :0.1881
## 3rd Qu.: 1.10 3rd Qu.: 1.90 3rd Qu.:0.2330
## Max. :42.52 Max. :45969.50 Max. :4.4500
## NA's :3974 NA's :3 NA's :3127
## magNst status locationSource magSource
## Min. : 0.0 Length:9243 Length:9243 Length:9243
## 1st Qu.: 4.0 Class :character Class :character Class :character
## Median : 8.0 Mode :character Mode :character Mode :character
## Mean : 16.4
## 3rd Qu.: 18.0
## Max. :551.0
## NA's :2971
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## -0.820 0.700 1.200 1.486 1.900 7.900 1
Summary statistics for Global Earthquake Dataset Maximum: 7.9 Minimum: -0.82
Median: 1.2 Mean: 1.4855085
According to UPSeis an Earthquake with a magnitude of greater than 6 is significant
Sig6Quake <- gEQdata[gEQdata$mag > 6,]
Sig6sum <- summary(Sig6Quake$mag, na.rm=T)
Sig5Quake <- gEQdata[gEQdata$mag > 5,]
Sig5sum <- summary(Sig5Quake$mag, na.rm=T)
Sig5sum## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 5.100 5.100 5.300 5.463 5.600 7.900 1
# sort classes
greatcnt <- count(gEQdata[gEQdata$mag>=8,])
majorcnt <- count(gEQdata[gEQdata$mag>=7,])
strongcnt <- count(gEQdata[gEQdata$mag>=6,])
moderatecnt <- count(gEQdata[gEQdata$mag>=5,])
lightcnt <- count(gEQdata[gEQdata$mag>=4,])
minorcnt <- count(gEQdata)magClasses <- data.table(Class =
c("Great","Major","Strong","Moderate",
"Light","Minor"),
Magn =
c("8 or more","7 - 7.9","6 - 6.9","5 - 5.9",
"4 - 4.9","3.9 and under"),
Est_Each_Year =
c("one every 5 to 10 years","20","100",
"500","50,000","990,000"),
Est_Each_Month =
c("0","1.5","8.3","41.6","2,500","75,000"),
This_Month =
c(greatcnt,majorcnt,strongcnt,moderatecnt,
lightcnt,minorcnt))
names(magClasses)[2] <- "Magnitude"
names(magClasses)[3] <- "Estimated Each Year"
names(magClasses)[4] <- "Estimated Each Month"
names(magClasses)[5] <- "This Month"
datatable(magClasses, rownames = F)Fit given points of Magnitude and Number of Earthquakes
# use Magnitude 5 and above events
Sig5Quake <- gEQdata[gEQdata$mag > 5,]
names(Sig5Quake)[2] <- "lat"
names(Sig5Quake)[3] <- "lon"
g <- list(
#scope = 'usa',
#projection = list(type = 'albers usa'),
showland = TRUE,
landcolor = toRGB("gray85"),
subunitwidth = 1,
countrywidth = 1,
subunitcolor = toRGB("white"),
countrycolor = toRGB("white")
)
p <- plot_geo(Sig5Quake, locationmode = 'USA-states', sizes = c(1, 250)) %>%
add_markers(
x = ~lon, y = ~lat, size = ~mag, color = ~magError, hoverinfo = "text",
text = ~paste(Sig5Quake$mag, "Magnitude","<br>",
Sig5Quake$place, "<br />",
Sig5Quake$time)
) %>%
layout(title = 'Dec 26, 2017 to January 25, 2018 Earthquakes over Magnitude 5', geo = g)
p## Warning: Ignoring 1 observations
## Warning: `line.width` does not currently support multiple values.